package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.MultiANewArrayInstructionBytecodeEvent;

public class MultiANewArrayInstructionBytecodeEventImpl extends BytecodeEventImpl implements
    MultiANewArrayInstructionBytecodeEvent
{
    private String componentDescriptor;
    private int dimensions;

    public MultiANewArrayInstructionBytecodeEventImpl(final String aComponentDescriptor, final int aDimensions) {
        componentDescriptor = aComponentDescriptor;
        dimensions = aDimensions;
    }

    @Override
    public int getType() {
        return MULTI_A_NEW_ARRAY_INSTRUCTION;
    }

    @Override
    public void setComponentDescriptor(final String aComponentDescriptor) {
        componentDescriptor = aComponentDescriptor;
    }

    @Override
    public String getComponentDescriptor() {
        return componentDescriptor;
    }

    @Override
    public void setDimensions(final int aDimensions) {
        dimensions = aDimensions;
    }

    @Override
    public int getDimensions() {
        return dimensions;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitMultiANewArrayInstruction(this);
        return aBytecodeVisitor;
    }
}
